/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.yy.bugzillahelp.action.product;

import com.yy.bugzillahelp.MainFrame;
import com.yy.bugzillahelp.action.download.ProductCrawlAction;
import com.yy.bugzillahelp.data.ProductData;
import com.yy.bugzillahelp.data.server.ServerData;
import com.yy.bugzillahelp.db.BugzillaHelpDB;
import com.yy.bugzillahelp.tool.SQLTool;
import java.sql.Connection;
import java.util.ArrayList;

/**
 *
 * @author hualun-alan
 */
public class TestAction {

    public static void main(String[] args) {
        ServerData serverData = MainFrame.CONNECT_DATA;
        Connection con = BugzillaHelpDB.getConnection();

        ArrayList<ProductData> productDatas = ProductCrawlAction.searchProducts(serverData);
        for (ProductData productData : productDatas) {
            System.out.println(productData);
            ProductAction.updateOne(con, productData, serverData.getId());
        }

        SQLTool.closeConnection(con);
    }
}
